let s1 = 'hello.txt at'
let b1 = Buffer.from(s1)
console.log(b1)

console.log(s1.length) //内存的大小
console.log(b1.length)//字符串的长度

let s2 = '我爱中国'
let b2 = Buffer.from(s2)
console.log(b2)
console.log(b2.toString())

console.log(s2.length) //内存的大小
console.log(b2.length)//字符串的长度

let b3 =  Buffer.alloc(10)
b3[0] = 255
b3[12] = 7
console.log(b3)
console.log(b3.length)

let b4 = Buffer.allocUnsafe(10)
console.log(b4)
console.log(b4.length)

